/**
 * Copyright (c) 2005-2012 https://github.com/zhangkaitao
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package com.kaoshi.myweb.web.controller.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * <p>User: Zhang Kaitao
 * <p>Date: 13-1-18 下午10:15
 * <p>Version: 1.0
 */
@Controller
@RequestMapping("/admin")
public class IndexController {

//    @Autowired
//    private ResourceService resourceService;
//
//    @Autowired
//    private PushApi pushApi;
//
//    @Autowired
//    private MessageService messageService;
//
//    @Autowired
//    private CalendarService calendarService;


    @RequestMapping(value = {"/{index:index;?.*}"}) //spring3.2.2 bug see  http://jinnianshilongnian.iteye.com/blog/1831408
    public String index() {

//        List<Menu> menus = resourceService.findMenus(user);
//        model.addAttribute("menus", menus);
//
//        pushApi.offline(user.getId());

        return "admin/index/index";
    }


    @RequestMapping(value = "/welcome")
    public String welcome( Model model) {

        //未读消息
        model.addAttribute("messageUnreadCount", 0);

        //最近3天的日历
        model.addAttribute("calendarCount", 0);

        return "admin/index/welcome";
    }





}
